import Vue from 'vue'
import VueRouter from 'vue-router'
// 路由的按需加载方式 =》 单个路由按需加载（app.js大小由2.8M变成了2.5M）
// import Home from './views/Home.vue'
const Home = () => import('./views/Home.vue')
// import DrawingDetail from './views/DrawingDetail.vue'
const DrawingDetail = () => import('./views/DrawingDetail.vue')

Vue.use(VueRouter)

export default new VueRouter({
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: Home
    },
    {
      path: '/drawingDetail',
      name: 'drawingDetail',
      component: DrawingDetail
    }
  ]
})
